package com.cndw.kungfu.model.operation.domain;

import java.io.Serializable;

import com.cndw.kungfu.vo.FruitVO;

/**
 * 树上的果子对象
 * 
 * @author fantadust [9677889@qq.com]
 * @date 2012-6-29 下午3:56:24
 */
public class PlayerFruit implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 编号
	 */
	private int id;

	/**
	 * 开始时间
	 */
	private int begin;
	/**
	 * 第几季
	 */
	private int season;
	/**
	 * 果实类型
	 */
	private int type;
	/**
	 * 果实等级
	 */
	private int level;
	/**
	 * 是否加速过
	 */
	private boolean fast;

	public PlayerFruit() {

	}

	public PlayerFruit(int id, int begin) {
		this.id = id;
		this.begin = begin;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getBegin() {
		return begin;
	}

	public void setBegin(int begin) {
		this.begin = begin;
	}

	public int getSeason() {
		return season;
	}

	public void setSeason(int season) {
		this.season = season;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}
	
	public boolean isFast() {
		return fast;
	}

	public void setFast(boolean fast) {
		this.fast = fast;
	}

	public FruitVO toVO() {
		FruitVO vo = new FruitVO();
		TreeFruit treeFruit = TreeFruit.getOne(type, level);
		vo.setBegin(begin);
		vo.setId(id);
		vo.setSeason(season);
		vo.setType(type);
		vo.setLevel(level);
		if (treeFruit != null) {
			vo.setName(treeFruit.getName());
		}
		return vo;
	}

}
